﻿//using Microsoft.EntityFrameworkCore;
//using Microsoft.Extensions.DependencyInjection;
//using System;
//using System.Collections.Generic;
//using System.Text;
//using OL.FrameCore.Infrastructure.Code;

//namespace WhatCatch.Core2.UnitOfWork
//{
//    public static class UnitOfWorkServiceCollectionExtensions
//    {
//		public static IServiceCollection AddUnitOfWork<TContext>(this IServiceCollection services) where TContext : DbContext
//		{
//			ServiceCollectionServiceExtensions.AddScoped<IUnitOfWork, EFUnitOfWork<TContext>>(services);
//			ServiceCollectionServiceExtensions.AddScoped<IUnitOfWork<TContext>, EFUnitOfWork<TContext>>(services);

//			services.RegisterScope(typeof(IRepositoryBase<>));

//			return services;
//		}

//		public static IServiceCollection AddReadUnitOfWork<TContext>(this IServiceCollection services) where TContext : DbContext
//		{
//			ServiceCollectionServiceExtensions.AddScoped<IUnitOfWork<TContext>, EFUnitOfWork<TContext>>(services);
//			return services;
//		}

//	}
//}
